package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.RepairBbsFallBack;
import cn.cs.fallback.RestShopFallBack;
import cn.cs.pojo.Shop;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = RestShopFallBack.class)
public interface RestShopClient {

    @RequestMapping(value = "/getShopList", method = RequestMethod.POST)
    public List<Shop> getShopList(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getShopById", method = RequestMethod.POST)
    public Shop getShopById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/getShopListByMap", method = RequestMethod.POST)
    public List<Shop>	getShopListByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getShopCountByMap", method = RequestMethod.POST)
    public Integer getShopCountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getShopNumberByAgentCode", method = RequestMethod.POST)
    public Long getShopNumberByAgentCode(@RequestParam("invitationCode") String invitationCode) throws Exception;


}

